/*
 * #%L
 * java model
 * %%
 * Copyright (C) 2009 - 2011 prefabware.com Stefan Isele
 * %%
 * All Rights Reserved.
 * This program is dual-licensed under the GNU General Public license
 * or a commercial license.
 * You may select to use one or the other of these licenses.
 * To obtain a commercial license please contact Stefan Isele at www.stefan-isele.de
 * Any modifications to this file must keep this entire header intact.
 * Redistribution, except as permitted by the selected license, is prohibited.
 * #L%
 */
package com.prefabware.jmodel.typefactory;

import com.prefabware.commons.QualifiedName;
import com.prefabware.jmodel.JThrowable;
import com.prefabware.jmodel.JType;
import com.prefabware.jmodel.JTypeDeclaration;

/**
 * to create instances of JExcpetion for java Exception <br>
 * 
 * @author sisele_job
 * 
 */
public class JThrowableTypeFactoryDelegee extends JClassTypeFactoryDelegee {

	protected JThrowableTypeFactoryDelegee() {
		super();
	}


	@SuppressWarnings("unchecked")
	@Override
	public <TYPE extends JType> TYPE newJType(QualifiedName qualifiedName, JTypeDeclaration declaration,
			JType... typeArguments) {
		return (TYPE) new JThrowable(qualifiedName, declaration, typeArguments);
	}

	@Override
	public boolean acceptType(Class<? extends JType> typeClass, QualifiedName qualifiedName) {
		return typeClass.equals(JThrowable.class);
	}

	@Override
	public JTypeClassVisitor getVisitor(JType... typeArguments) {
		return new JClassClassVisitor( typeFactory,typeArguments);
	}
	
}
